/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.money.dao.impl;

import com.money.dao.TypeDao;
import com.money.entity.Type;
import com.money.mapper.TypeMapper;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Eason
 */
@SuppressWarnings("unchecked")
@Repository("typeDao")
public class TypeDaoImpl implements TypeDao {

    @Resource(name = "typemapper")
    private TypeMapper mapper;

    @Override
    public void addType(Type type) {
        mapper.addType(type);
    }


    public void editType(Type type) {
        System.out.println(type.getId());
        System.out.println(type.getTypeID());
        System.out.println(type.getTypeName());
        mapper.editType(type);
    }

    @Override
    public void removeType(int id) {
        mapper.removeType(id);
    }

    public Type getTypeByID(int id) {
        return mapper.getTypeByID(id);
    }

    @Override
    public List getAllType() {
        return mapper.getAllType();
    }

    @Override
    public List getAllSubtype() {
        return mapper.getAllSubtype();
    }

    @Override
    public List getSubTypeByType(String typeID) {
        return mapper.getSubTypeByType(typeID);
    }

    public List getTypeByTypeID(String typeID) {
        return mapper.getTypeByTypeID(typeID);
    }
}
